package arr;

public class test2MaxInArr {
    public static int compare(int[] arr) {
        int temp, max = 0;
        for(int i :arr){
            temp = arr[i];
            if(temp > max){
                max = temp;
            }
        }
        return max;
    }
    public static void main(String[] args) {
        int[] arr = {1, 3, 5, 7, 9, 2, 4, 6, 8, 10, 2, 4, 6, 1, 9};
        int result = compare(arr);
        System.out.println(result);
    }
}
